package com.anyisn.anyflickr.shell.controller.slide
{
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
	
	import com.anyisn.anyflickr.shell.model.SettingsProxy;
	import com.anyisn.anyflickr.shell.model.vo.PhotoListVO;
	import com.anyisn.anyflickr.shell.view.PhotosSlideModuleMediator;
	import com.anyisn.anyflickr.modules.PhotosSlide.PhotosSlideModule;
	import com.anyisn.puremvc.as3.multicore.utilities.pipes.event.ModuleEvents;
	
	public class PhotosSlideWindowOpenCommand extends SimpleCommand
	{
		override public function execute(notification:INotification) : void {
			var plVO:PhotoListVO = notification.getBody() as PhotoListVO;
			var settings:SettingsProxy = facade.retrieveProxy(SettingsProxy.NAME) as SettingsProxy;
			var ps:PhotosSlideModule = new PhotosSlideModule(plVO, settings.slideDelay);
			sendNotification(ModuleEvents.CONNECT_MODULE_JUNCTION, ps);
       		facade.registerMediator(new PhotosSlideModuleMediator(ps));
		}
	}
}